import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * c3p0和druid数据源的添加（1. 直接在配置文件的写入 2.使用外部的配置文件 ）
 * */

public class App {
    public static void main(String[] args) {
        //1.加载类路径下的配置文件
//        ApplicationContext act=new ClassPathXmlApplicationContext("applicationContext.xml");
        /*DataSource druid = (DataSource) act.getBean("druid");
        System.out.println(druid);
        DataSource c3p0 = (DataSource) act.getBean("c3p0");
        System.out.println(c3p0);*/
        //2.加载文件系统下的配置文件
        ApplicationContext act = new FileSystemXmlApplicationContext("D:\\Demo\\JavaDemo\\spring\\spring02_datasource\\src\\main\\resources\\applicationContext.xml");
        TestProperties properties = (TestProperties) act.getBean("properties");
        properties.save();

    }
}
